Adaptive quality control for monitoring wellbore drilling

ABSTRACT

A method of validating a directional survey includes measuring the gravity and magnetic field vectors using a surveying tool and computing an overall statistical distance of the measurement. The statistical distance may be calculated from reference values associated with the surveying tool using corresponding surveying tool codes with error values. In a further aspect, an error covariance matrix may be used to determine whether the new errors m a survey are consistent or not with errors from one or more previous surveys.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. Provisional Patent ApplicationSer. No. 62/570,865 filed on Oct. 11, 2017, which is incorporated hereinby reference in its entirety, and claims priority to U.S. ProvisionalPatent Application Ser. No. 62/655,675, filed on Apr. 10, 2018, which isincorporated herein by reference in its entirety.

BACKGROUND Field of the Disclosure

The present disclosure relates generally to drilling of wells for oiland gas production and, more particularly, to adaptive quality controlfor monitoring wellbore drilling.

Description of the Related Art

In well placement using measurement-while-drilling (MWD), Earth'sgravity acceleration and geomagnetic field are used as a naturalreference frame. A MWD tool may measure a survey of the accelerationvector and the magnetic field vector to determine a 3D orientation ofthe MWD tool, including to infer an inclination angle and an azimuthangle of the bottom hole assembly (BHA). From consecutive MWD surveys,the well trajectory can be determined in this manner and can be used tovalidate that the actual well trajectory remains on target with aplanned well trajectory.

The determination of the well trajectory from an MWD survey may involvevarious calculations that depend upon reference values and measuredvalues. However, various internal and external factors may adverselyabet an MWD survey and, in turn, the determination of the welltrajectory. Furthermore, certain measurement thresholds used for qualitycontrol (QC) of different measurements may not be uncorrelated with eachother, as is commonly assumed in conventional QC methods.

SUMMARY

In one aspect, a first system for monitoring drilling is disclosed. Thefirst system may include a processor, a memory coupled to the processor.In the first system, the memory may include instructions executable bythe processor for, during drilling of a borehole by a drilling system,receiving a first survey from a measurement-while-drilling (MWD) tool.In the first system, the first survey may include a first measurement ofa gravity vector G and a second measurement of a magnetic field vectorB. The first system may further include instructions for calculating amagnetic dip angle φ responsive to the second measurement of themagnetic field vector B, generating, responsive to tool codes for theMWD tool that define error values for the first measurement and thesecond measurement, a first covariant matrix describing the relationshipof a plurality of measured values to expected errors in the measuredvalues; generating a plurality of residual values corresponding to thefirst measurement and the second measurement as a difference between areference value and a measured value for each of first measurement ofthe gravity vector G and the second measure lent of the magnetic fieldvector B, computing, responsive to the residual values and the firstcovariant matrix, an error ellipsoid describing bounds for residualvalues for the first measurement of the gravity vector G and the secondmeasurement of the magnetic field vector B, and comparing the firstsurvey with the error ellipsoid to determine if the first survey isacceptable. When the first survey is not acceptable based en the errorellipsoid, the first system may further include instructions forgenerating a first indication that the drilling should stop.

In any of the disclosed embodiments, the first system may furtherinclude instructions for, when the first indication is generated,generating a second indication that an expert assessment of a trajectoryof the borehole is to be performed before drilling resumes.

In any of the disclosed embodiments, the first system may furtherinclude instructions for generating a plurality of second residualvalues based on differences between a plurality of previously measuredvalues of the gravity vector G and the magnetic vector B, and the mostrecent measurements of the gravity vector G and the magnetic, vector B,generating a second covariant matrix describing the relationship ofmeasured values to expected errors in the measured values based on thepreviously measured values, and computing a second error ellipsoiddescribing bounds for residual values for the first measurement of thegravity vector G and the second measurement of the magnetic field vectorB responsive to the second residual values and the second covariantmatrix.

In any of the disclosed embodiments of the first system, theinstructions for comparing the first survey with the error ellipsoid todetermine if the first survey is acceptable may further includeinstructions for computing a statistical distance associated with thefirst measurement of the gravity vector G and the second measurement ofthe magnetic field vector B responsive to the tool codes.

In any of the disclosed embodiments, the first system may furtherinclude instructions for displaying the statistical distance against asigma threshold.

In any of the disclosed embodiments of the first system, theinstructions for comparing the first survey with the error ellipsoid to,determine if the first survey is acceptable may further includeinstructions for classifying the first survey as pass or lint, based ona value of the statistical distance with respect to the sigma threshold.

In any of the disclosed embodiments of the first system, theinstructions for comparing the first survey with the error ellipsoid todetermine if the first survey is acceptable may further includeinstructions for computing a probability associated with the firstmeasurement of the gravity vector G and the second measurement of themagnetic field vector B responsive to the tool codes.

In any of the disclosed embodiments, the first system may furtherinclude instructions for displaying the probability against aprobability threshold.

In any of the disclosed embodiments of the first system, theinstructions for comparing the first survey with the error ellipsoid todetermine if the first survey is acceptable may further includeinstructions for classifying the first survey as pass or fail, based ona value of the probability with respect to the probability threshold.

In any of the disclosed embodiments of the first system, the probabilitymay be a Mahalanobis distance.

In another aspect, a first method for monitoring drilling is disclosed.The first method may include during drilling of a borehole by a drillingsystem, receiving a first survey front measurement-while-drilling (MWD)tool. In the first method, the first survey may include a plurality ofmeasurements of a gravity vector and a magnetic field vector. The firstmethod may further include using the magnetic field vector, calculatinga magnetic dip angle, responsive to plurality of tool codes for the MWDtool that define error values for the plurality of measurements,generating a first covariant matrix describing the relationship ofmeasurements to expected errors in the measurements, and generating aplurality of residual values corresponding to the plurality ofmeasurements in the first method, each residual value may include adifference between a reference value and a measured value for each ofthe plurality of measurements. The first method may further include,responsive to the residual values and the first covariant matrix,computing an error ellipsoid describing bounds for residual values forthe plurality of measurements, and comparing the first survey with theerror ellipsoid to determine if the first survey is within acceptablelimits. When the first survey is not within acceptable limits, the firstmethod may further include generating a first indication that thedrilling should stop.

In any of the disclosed embodiments, the first method may furtherinclude, when the first indication is generated, generating a secondindication that an expert assessment of a trajectory of the boreholeshould be performed before drilling resumes.

In any of the disclosed embodiments, the first method may furtherinclude generating second residual values based on differences betweenpreviously obtained measurements and the measured value for each of theplurality of measurements, generating a second, covariant matrixdescribing the relationship of measured values to expected errors in themeasured values based on the previously measured values, and, responsiveto the second residual values and the second covariant matrix, computingthe error ellipsoid describing bounds for residual values for themeasurements.

In any of the disclosed embodiments of the first method, comparing thefirst survey with the error ellipsoid to determine if the first surveyis acceptable may further include computing a statistical distanceassociated with the measurements based on the tool codes.

In any of the disclosed embodiments, the first method may furtherinclude displaying the statistical distance against a sigma threshold.

In any of the disclosed embodiments of the first method, comparing thefirst survey with the error ellipsoid to determine if the first surveyis acceptable may further include classifying the first survey as passor fail, based on a value of the statistical distance with respect tothe sigma threshold.

In any of the disclosed embodiments of the first method, comparing thefirst survey with the error ellipsoid to determine if the first surveyis acceptable may further include computing a probability associatedwith the measurements based on the tool codes.

In any of the disclosed embodiments, the first method may furtherinclude displaying the probability against a probability threshold.

In any of the disclosed embodiments of the first method, comparing thefirst survey with the error ellipsoid to determine if the first surveyis acceptable may further include classifying the first survey as passor fail, based on a value of the probability with respect to theprobability threshold.

In any of the disclosed embodiments of the first method, the probabilitymay be a Mahalanobis distance.

In any of the disclosed embodiments, the first method may furtherinclude displaying at least one indication of the gravity vector, themagnetic field vector, and the magnetic dip angle together with innererror limits, while the inner error limits may define a pass range.

In any of the disclosed embodiments, the first method may furtherinclude displaying at least one indication of the gravity vector, themagnetic field vector, and the magnetic dip angle together with outererror limits, wherein the outer error limits define a fail, threshold.

In any of the disclosed embodiments, the first method may furtherinclude displaying at least one indication of the gravity vector, themagnetic field vector, and the magnetic dip angle together with bothinner error limits and outer error limits, wherein the ranges betweenthe inner error limits and the outer error limits indicate a pass orfail range.

In yet another aspect, a second system for monitoring drilling isdisclosed. The second system may include a processor, a memory coupledto the processor, a display device coupled to the processor. In thesecond system the memory may include instructions executable by theprocessor for, during drilling of a borehole by a drilling system,receiving a first survey from a measurement-while-drilling (MWD) tool.In the second system, the first survey may include measurements of agravity vector and a magnetic field vector. The second system mayfurther include instructions for, responsive to the magnetic fieldvector, calculating a magnetic dip angle, responsive to tool codes forthe MWD tool that define error values corresponding to the measurements,generating a first covariant matrix describing the relationship of aplurality of measured values to a plurality of expected errors in themeasured values, generating residual values corresponding to themeasurements as differences between each reference value and eachassociated measured value for each of the measurements, responsive tothe residual values and the first covariant matrix, computing astatistical distance associated with the measurements, the statisticaldistance describing bounds for residual values for the measurements, anddisplaying on the display device a comparison of at least a portion ofthe first survey with the statistical distance to provide a visualindication of whether the survey is within acceptable limits.

In any of the disclosed embodiments, the second system may furtherinclude instructions for, when the first survey is not within acceptablelimits, generating a first indication that the drilling should stop.

In any of the disclosed embodiments, the second system may furtherinclude instructions for, when the first indication is generated,generating a second indication that an expert assessment of a wellboretrajectory of the borehole is to be performed before drilling canresume.

In any of the disclosed embodiments, the second system may furtherinclude instructions for generating second residual values based ondifferences between previously measured values and a most recentlymeasured value for each of the measurements, generating a secondcovariant matrix describing the relationship of measured values toexpected errors in the measured values based on the previously measuredvalues, and using the second residual values and the second covariantmatrix, computing the statistical distance describing bounds forresidual values for the measurements.

In any of the disclosed embodiments of the second system, theinstructions for comparing the first survey with the statisticaldifference to determine if the first survey is acceptable may furtherinclude instructions for computing an error ellipsoid associated withthe measurements based on the tool codes.

In any of the disclosed embodiments, the second system may furtherinclude instructions for displaying the error ellipsoid against at leastone sigma threshold.

In any of the disclosed embodiments of the second system, theinstructions for comparing the first survey with the error ellipsoid todetermine if the first survey is acceptable may further includeinstructions for classifying the first survey as pass or fail, based ona value of the statistical distance with respect to the sigma threshold.

In any of the disclosed embodiments of the second system, a sigmathreshold may be displayed as a rectangle bounded by the errorellipsoid.

In any of the disclosed embodiments of the second system, the comparisonmay be displayed as a plot with at least one shaded region representinga QC threshold. In any of the disclosed embodiments of the secondsystem, the comparison may be displayed as a plot of measurement valuesbounded by inner limits and outer limits.

In any of the disclosed embodiments of the second system, the innerlimits may indicate pass or fail of the measurement values and the outerlimits may indicate fail of the measurement values.

In any of the disclosed embodiments of the second system, the areabetween the inner limits may be displayed as a first color, and the areabetween each inner limit and the corresponding, outer limit may bedisplayed as a second color. In any of the disclosed embodiments of thesecond system, the first color may be green. In any of the disclosedembodiments of the second system, the second color may be yellow.

In any of the disclosed embodiments, the second system may furtherinclude instructions for accessing data from at least one previoussurvey of the borehole performed prior to the first survey, while theinner limits and the outer limits may be adaptive responsive to the atleast one previous survey. In any of the disclosed embodiments of thesecond system, the visual indication may be updated with additional dataresponsive to a second survey performed after the first survey. In anyof the disclosed embodiments of the second system, the visual indicationmay be updated with additional data as the borehole is drilled.

In yet another aspect, a second method of validating a directionalsurvey includes defining quality control (QC) criteria directly from theerror model that is used to compute the uncertainties of the welltrajectory. The error model describes errors of the measurement whiledrilling (MWD) tool and additional factors, such as the error inreference values, external interference, the impact of correctionsapplied to the measurements, and correlation of errors between separatesurvey measurements. While error models (tool codes were designed tocompute the uncertainties of the well trajectory, the error models mayalso be used to derive the uncertainties of an individual MWDmeasurement. In the same way that 3D error ellipsoids of the wellborelocation are computed, 3D error ellipsoids for G, B and magnetic dipangle φ can also be computed.

In another aspect a third method of validating a directional surveyincludes measuring the gravity and magnetic field vectors using asurveying tool and computing an overall statistical distance of themeasurement from its reference values, for a given surveying tool errormodel.

In a further aspect, a fourth method of validating a directional surveyincludes measuring the gravity and magnetic field vectors using asurveying tool, computing the parameters total gravity strength, totalmagnetic field strength, and magnetic dip, and computing individualstatistical distances between these parameters and their referencevalues for a given surveying tool error model.

In still another aspect, a fifth method of validating a directionalsurvey includes measuring the gravity and magnetic field vectors using asurveying tool, computing the parameters total gravity strength, totalmagnetic field strength, and magnetic dip, and computing inner and outererror bounds for each of these parameters.

In a further aspect, a sixth method of validating a directional surveyincludes measuring the gravity and magnetic field vectors using asurveying tool and computing an overall statistical distance of themeasurement from a conditional expectation derived from reference valuesfor a given tool error model and prior survey measurements collected ofthe gravity and magnetic field vectors.

In yet a further aspect, a seventh method of validating a directionalsurvey includes taking a number of measurements of the gravity andmagnetic field vectors using a surveying tool or set of survey tools,computing an overall statistical distance of the set from referencevalues for a given tool error and evaluating this statistical distancewith respect to the information content of the set.

BRIEF DESCRIPTION OF DRAWINGS

The following is a description of the figures in the accompanyingdrawings. The figures are not necessarily to scale, and certain figuresand certain views of the figures may be shown exaggerated in scale or inschematic in the interest of clarity and conciseness.

FIG. 1 is a depiction of a drilling system for drilling a borehole;

FIG. 2A is a geometric depiction of magnetic field vectors as generatedby a magnetometer;

FIG. 2B is a geometric depiction of gravity vectors as generated by anaccelerometer;

FIGS. 3A, 3B, 3C, and 3D depict selected elements of an embodiment of amethod for adaptive quality control for monitoring wellbore drilling;

FIG. 4 depicts a QC threshold 3D ellipsoid depicting 2.8 sigma error;

FIG. 5 depicts a QC threshold 3D ellipsoid with threshold regionsoverlaid thereon;

FIG. 6 is a plot showing statistical distance (sigma) as a function ormeasured depth along a wellbore;

FIG. 7 is a plot showing residual value statistical distances as afunction of measured depth along a wellbore for magnetic field strengthB;

FIG. 8 is a plot showing residual value statistical distances as afunction of measured depth along a wellbore for gravity field G;

FIG. 9 is a plot showing residual value statistical distances as afunction of measured depth along a wellbore for magnetic dip angle φ;

FIG. 10 is a plot showing statistical probability as a function ofmeasured depth along a wellbore;

FIG. 11 shows three plots of residual values of B, G, and φ againstadaptive QC thresholds versus measured depth;

FIG. 12A shows a plot of actual values of B against adaptive QCthresholds versus measured depth; and

FIG. 12B shows a plot of actual values of φ against adaptive QCthresholds versus measured depth.

DETAILED DESCRIPTION

In the following description, details are set forth by way of example tofacilitate discussion of the disclosed subject matter. It should beapparent to a person of ordinary skill in the field, however, that thedisclosed embodiments are exemplary and not exhaustive of all possibleembodiments.

Throughout this disclosure, a hyphenated form of a reference numeralrefers to a specific instance of an element and the un-hyphenated formof the reference numeral refers to the element generically orcollectively. Thus, as an example (not shown in the drawings), device“12” refers to an instance of a device class, which may be referred tocollectively as devices “12” and any one of which may be referred togenerically as a device “12”. In the figures and the description, likenumerals are intended to represent like elements.

As noted above, various factors associated with the performance of MWDsurveys may affect the determination of the well trajectory. Forexample, the accuracy of the well trajectory determination may depend onthe performance of an MWD tool used for an MWD survey. It may thereforebe useful to apply quality control (QC) to each MWD survey to monitorand evaluate the performance of the MWD tool.

As will be disclosed in further detail, application of QC to an MWDsurvey can be accomplished by comparing a measured gravity fieldstrength (given by a Vector G), a measured magnetic field strength(given by a vector B), and a magnetic dip angle (given as an angle φ)with respective reference values that may be given or may be obtainedfrom previous surveys. The differences between the measured values andthe reference values are called “residual values”. Various different QCcriteria may be defined based on these residual values, including QCcriteria disclosed herein for adaptive quality control for monitoringwellbore drilling.

In some conventional processing methods, given QC thresholds for B, Gand φ may be defined as QC pass or Mil criteria for an MWD survey. Whenthe QC thresholds an exceeded, the MWD survey is said to fail QC andshould not be used for determination of the well trajectory. Theconventional approach with given QC thresholds may have certainshortcomings, such as, but not limited to: (1) a reliance on threeseparate measurements, which may not consider any cross-correlation ofamong the measurements; (2) no relation of the QC criteria to knownuncertainties in the determination of the wellbore trajectory; and (3)failure to evaluate the survey results as a collection of survey setsrather than as isolated data points. Therefore, an improved approach forvalidating directional surveys is disclosed herein as adaptive qualitycontrol for monitoring wellbore drilling.

Application of QC for adaptive quality control for monitoring wellboredrilling, as disclosed herein, may be used as an integrated part of adrilling process that is implemented using a drilling system. Theresults of application of the QC criteria to each respective MWD surveyperformed may be used to evaluate the quality of the measurement, andultimately determine whether the last measurement could be validated asbeing acceptable for drilling purposes, such as for determining the welltrajectory. In other words, QC using adaptive quality control formonitoring wellbore drilling may improve a determination of theplausibility of each measurement from an MWD survey. The level ofacceptability, as well as other QC criteria, for actual drillingpurposes may be set forth, along with other information and parameters,in a drilling plan that may define the drilling operations and also mayspecify the well trajectory.

A method for adaptive quality control for monitoring wellbore drilling,as disclosed herein, may perform MWD surveys while drilling proceedsalong a well trajectory. Each of the MWD surveys may be evaluated usingadaptive QC criteria to make a decision whether or not drilling shouldcontinue. When the last MWD survey is validated using the adaptivequality control for monitoring wellbore drilling disclosed herein, anindication may, be generated that drilling can continue. The indicationthat the last MWD survey was validated may be incorporated as a digitalsignal or digital information that is used by another control system inthe drilling system, such as in order to control the drilling process orin order to not stop the drilling process. When the last MWD survey isnot validated using the adaptive quality control for monitoring wellboredrilling disclosed herein, an indication may be generated that drillingshould stop. The indication that the last MWD survey was not validatedmay be incorporated as a digital signal or digital information that isused by another control system in the drilling system, such as in orderto control the drilling process or in order to stop the drillingprocess.

A method for adaptive quality control for monitoring wellbore drilling,as disclosed herein, may further include defining QC criteria directlyfrom the uncertainties in the determination of the well trajectory. Theuncertainties may be given as certain error values that describe errorsof the MWD tool and additional factors, such as an error in referencevalues, external interference, an impact of corrections applied to themeasurements, and a correlation of errors between separate surveymeasurements. It is noted that certain error values (e.g., MWD toolcodes that define instrument parameters) are given that may be used tocompute the uncertainties of the well trajectory. In adaptive qualitycontrol for monitoring wellbore drilling, as disclosed herein, the sameerror values may also be used to derive the uncertainties of anindividual MWD measurement. The uncertainties resulting from the QCprocess may be presented as 3D error ellipsoids for values of B, G, andφ obtained from MWD surveys. The error ellipsoids may present the errorin three dimensional coordinates along borehole 106, while the errorsfor B, G, and φ may be related to each other, at least to a certaindegree, along at least one dimensional axis.

In directional drilling, the well trajectory may be reconstructed from apipe tally (measured depth, MD) combined with surveys of an inclinationangle and an azimuth angle of the borehole or the drill string.Accordingly, point measurements of MD, the inclination angle, and theazimuth angle may then combined to generate a continuous determinationof the well trajectory. In some instances, the point measurements may becombined using a minimum curvature interpolation to generate thedetermination of the well trajectory. The positional errors of thedetermination of the well trajectory may be described by ellipsoids ofuncertainty (EOU), where the axes of a three dimensional (3D) coordinatesystem used to specify the ellipsoids may indicate standard error in thelateral, vertical, and along-hole directions, respectively.

The along-hole directional error may be considered related to the drillpipe and is not considered further here.

For the cross-hole errors (i.e., the lateral directional errors and thehorizontal directional errors for straight vertical drilling), thefollowing sources of error may be taken into account instrument biasesand scale factors; sensor misalignments within the MWD tool;misalignment of the MWD sensor with the borehole; sensor misalignmentsdue to the bending (i.e., sag) of the drill string component housingusing the MWD tool; magnetic interference from the drill string; anderrors in the gravity and geomagnetic reference values, a long othersources of errors. Even when the exact source of the error is unknown,as long as the relationship of the error to QC criteria is known, theextent of the error can be estimated using adaptive quality control formonitoring wellbore drilling.

Each, of the sources of cross-hole errors may be quantified by one ormore error coefficients and may be associated with a propagation mode.The errors may then be translated using the error coefficients intocorresponding errors of the inclination angle and the azimuth angle,which may then be propagated along-hole to determine a cumulative errorof the well trajectory. In a similar manner as determining the error inthe well trajectory, the methods for adaptive quality control formonitoring wellbore drilling, as disclosed herein, determine an expectederror in actual measurements from an MWD tool used for an MWD survey.

As a result of adaptive quality control for monitoring wellboredrilling, as disclosed herein, three independent parameters may becomputed, namely: strength of the gravity field (G), strength of themagnetic field (B), and magnetic dip angle φ. B, G, and φ may becomputed from as MWD survey and are, thus, derived from measured values.Reference values for B and G may be obtained from global references, orfrom previous survey information obtained from previous drilling. Aftersubtracting the reference values from the values of B and G derived frommeasured values, the residual values are calculated. The residual valuesmay be used to define QC criteria and to apply the results of QCanalysis to drilling operations. For example, when a particular surveyfails the QC criteria, a measurement from an MWD tool may be flagged ashaving failed QC. The failed measurement may then be excluded from thecomputation of the well trajectory. Alternatively, remedial actions maybe taken to either improve the quality of the survey or assign thesurvey to another instrument specification of reduced accuracy.

Referring to FIG. 1, a drilling system 100 is illustrated in oneembodiment as a top drive system. As shown, the drilling system 100includes a derrick 132 on the surface 104 of the earth and is used todrill a borehole 106 into the earth. Typically, drilling system 100 isused at a location corresponding to a geographic formation 102 in theearth that is known.

In FIG. 1, derrick 132 includes a crown block 134 to which a travelingblock 136 is coupled via a drilling line 138. In drilling system 100, atop drive 140 is coupled to traveling block 136 and provides rotationalthree for drilling. A saver sub 142 may sit between the top drive 140and a drill pipe 144 that is part of a drill string 146. Top drive 140may rotate drill string 146 via the saver sub 142, which in turn mayrotate a drill bit 148 of a bottom hole assembly (BHA) 149 in borehole106 passing through formation 102. Also visible in drilling system 100is a rotary table 162 that may be fitted with a master bushing 164 tohold drill string 146 when not rotating.

A mud pump 152 may direct a fluid mixture 153 (e.g., a mud mixture) froma mud pit 154 into drill string 146. Mud pit 154 is shown schematicallyas a container, but it will be understood that various receptacles,tanks, pits, or other containers may be used. Mud 153 may flow from mudpump 152 into a discharge line 156 that is coupled to a rotary hose 158by a standpipe 160. Rotary hose 158 may then be coupled to top drive140, which includes a passage for mud 153 to flow into borehole 106 viadrill string 146 from where mud 153 may emerge at drill bit 148. Mud 153may lubricate drill bit 148 during drilling and, due to the pressuresupplied by mud pump 152, mud 153 may return via borehole 106 to surface104.

Sensing, detection, measurement, and evaluation functionality may beincorporated into a downhole tool 166 or BHA 149 or elsewhere alongdrill daring 146 to provide MWD surveys of borehole 106. Accordingly,downhole tool 166 may be an MWD tool and may have correspondingconnectivity to ground 146. For example, gamma radiation sensors,magnetometers, accelerometers, and other types of sensors may be usedfor the MWD surveys. Although downhole tool 166 is shown in singular indrilling system 100, it will be understood that multiple instances (notshown) of downhole tool 166 may be located at one or more locationsalong drill string 146.

In some embodiments, formation detection and evaluation functionalitymay be provided via a control system 168 on the surface 104. The controlsystem 168 may be located in proximity to derrick 132 or may be includedwith drilling system 100. In other embodiments, such as when drillingsystem 100 is equipped with a communication network (not shown), controlsystem 168 may be remote from the actual location of borehole 106. Forexample, control system 168 may be a stand-alone system or may beincorporated into other systems included with drilling system 100.

In operation, control system 166 may receive formation information viathe communication network. In some embodiments, control system 168 mayuse the evaluation functionality to provide convergence plans or othercorrective measures. The convergence plans or other corrective measuresmay depend on the determination of the well trajectory, and therefore,may be improved in accuracy using adaptive quality control formonitoring wellbore drilling, as disclosed herein. In variousembodiments, at least a portion of control system 168 may be located indownhole tool 166 (not shown). In some embodiments, control system 168may communicate with a separate controller (not shown) located indownhole tool 166. In particular, control system 168 may receive andprocess measurements received from MWD surveys and may perform thecalculations described herein for adaptive quality control formonitoring wellbore drilling using the MWD surveys and other informationreferenced herein.

Drilling a well typically involves a substantial amount of humandecision making during the drilling process. For example, geologists anddrilling engineers use their knowledge, experience, and the availableinformation to make decisions on how to plan the drilling operation, howto accomplish the drilling plan, and how to handle issues that ariseduring drilling. However, even the best geologists and drillingengineers perform some guesswork due to the unique nature of eachborehole. Furthermore, a directional driller directly responsible forthe drilling may have drilled other boreholes the same region and so mayhave some similar experience, but it is impossible for a human tomentally track all the possible inputs and factor those inputs into adecision. This can result in expensive mistakes, as errors in drillingcan add hundreds of thousands or even millions of dollars to thedrilling cost and, in some cases, drilling errors may permanently lowerthe output of a well, resulting in substantial long term losses.

In the present example, to aid in the drilling process, each well hascorresponding collected data, such as from sensors in the bottom holeassembly, the MWD tool, or both. The collected data may include thegeological characteristics of a particular formation in which thecorresponding well was formed, the attributes of a particular drillingrig, including the bottom hole assembly (BHA), and drilling informationsuch as weight-on-bit (WOB), drilling speed, and other informationpertinent to the formation of that particular borehole. The drillinginformation may be associated with a particular depth or otheridentifiable marker so that, for example, it is recorded that drillingof the well from 1,000 feet to 1,200 feet occurred at a first rate ofpenetration (ROP) through a first rock layer with a first WOB, whiledrilling from 1,200 feet to 1,500 feet occurred at a second ROP througha second rock layer with a second WOB. The collected data may be used torecreate the drilling process used to create the corresponding well inthe particular formation. It is understood that the accuracy with whichthe drilling process can be recreated depends on the level of detail andaccuracy of the collected data, including data from an MWD survey of thewell trajectory.

The collected data may be stored in a centralized database, which may beconnected via a communication channel to at least one computer, server,network, or combinations thereof. The database or computer systems maybe located at a drilling hub (not shown) or elsewhere. Alternatively,the data may be stored on a removable storage medium that is latercoupled to the database in order to transfer the data to the database.

An on-site controller may be located at or near the surface where a wellis being drilled. The controller may be coupled to the drilling rig andmay also be coupled to the database. Other inputs, including data from amagnetometer, and an accelerometer may also be provided to the on-sitecontroller. In some embodiments, the on-site controller may operate as astand-alone device with the drilling rig. For example, the on-sitecontroller may not be communicatively coupled to the database. Althoughit may be positioned near or at the drilling rig in the present example,it is to be understood that some or all components of the on-sitecontroller may be distributed and physically located elsewhere in otherembodiments, such as at a remotely located control center if desired.The controller may include a computer processor and a storage device,such as a memory storing instructions executable by the processor, theinstructions being enabled, when executed, for performing adaptivequality control for monitoring wellbore drilling, as disclosed herein.

The on-site controller may further form all or part of a surfacesteerable system. The database may also form part of the surfacesteerable system. The surface steerable system may be used to plan andcontrol drilling operations based on input information, includingfeedback from the drilling process itself. The surface steerable systemmay be used to perform operations, such as receiving drilling datarepresenting a drill path, receiving other drilling parameters,calculating a drilling solution for the drill path based on the receiveddata and other available data (e.g., rig characteristics), implementingthe drilling solution at the drilling rig, monitoring the drillingprocess to gauge whether the drilling process is within, a definedmargin of error of the drill path, and calculating corrections for thedrilling process if the drilling process is outside of the margin oferror. In addition, the on-site controller may form a portion of the MWDtool or the BHA.

In the present example, the drilling rig includes drilling equipmentused to perform the drilling of a borehole, such as top drive or rotarydrive equipment that couples to the drill string and BHA, and isconfigured to rotate the drill string and apply pressure to the drillbit. The drilling rig may include control systems such as aWOB/differential pressure control system, a positional rotary controlsystem, and a fluid circulation control system. The control systems maybe used to monitor and change drilling rig settings, such as the WOB ordifferential pressure to alter the ROP or the radial orientation of thetoolface, change the flow rate of drilling mud, and perform otheroperations. The drilling rig may also include a sensor system forobtaining sensor data about the drilling operation and the drilling rig,including the downhole equipment. For example, the sensor system mayinclude MWD or logging while drilling (LWD) components for obtaininginformation such as toolface and formation logging information that maybe saved the later retrieval, transmitted with a delay or in real timeusing any of various communication means (e.g., wireless, wireline, ormud pulse telemetry), or otherwise transferred to the on-sitecontroller. Such information may include information related to holedepth, bit depth, inclination, azimuth, true vertical depth, gammacount, standpipe pressure, mud flow rate, rotary rotations per minute(RPM), bit speed, ROP, WOB, and other information. It is understoodthat, all or part of the sensor system may be incorporated into acontrol system, or in another component of the drilling equipment. Asthe drilling rig can be configured in many different ways, it isunderstood that these control systems may be different in someembodiments, and may be combined or further divided into varioussubsystems.

The on-site controller may receive input information directly orindirectly from one or more sensors, as well as survey information,either during or after drilling of the wellbore. The input informationmay include information that is pre-loaded, received, and updated inreal time. The input information lay also include a well plan, regionalformation history, drilling engineer parameters, MWD toolface/inclination. Information, LWD gamma/resistivity information,economic parameters, reliability parameters, and other decision guidingparameters. Some of the inputs, such as the regional formation history,may be available from a drilling hub, which may include the database andthe processor (not shown), while other inputs may be accessed oruploaded from other sources. For example, a web interface may be used tointeract directly with the on-site controller to upload the well plan ordrilling engineer parameters. The input information may be provided tothe on-site controller and, after processing by the on-site controller,may result in control information that may be output to the drilling rig(e.g., to the control systems). The drilling rig (e.g., via the controlsystems) may provide feedback information to the on-site controller. Thefeedback information may then serve as input to the on-site controller,enabling the on-site controller to verify that the current controlinformation is producing the desired results or to produce new controlinformation for the drilling rig, which may include instructions foradjusting one or more drilling parameters, the direction of drilling,the appropriate drilling mode, and the like, and may further includeinstructions to the control systems to automatically drill in accordancewith the updated information regarding the location of the BHA asdetermined using adaptive quality control for monitoring wellboredrilling, as disclosed herein.

Referring now to FIGS. 2A and 2B, Cartesian-coordinate vector diagramsare shown depicting certain measurements that are used to derive QCparameters for adaptive quality control for monitoring wellboredrilling, as disclosed herein. Specifically, in FIG. 2A magnetometermeasurements 200 show how a total magnetic field vector B isgeometrically defined, while in FIG. 2B accelerometer measurements 201show how a total gravity vector G is geometrically defined. As notedpreviously, total magnetic field B and total gravity G may representmeasurements obtained using an MWD tool. Specifically, the raw axialmeasurements from the MWD tool for a magnetometer (magnetometermeasurements 200) and for an accelerometer (accelerometer measurements201) may be obtained and used for adaptive quality control formonitoring wellbore drilling, as will be described in further detailbelow. The Cartesian-coordinate vector diagrams shown in FIGS. 2A and 2Bdefine an XYZ coordinate space that may be used to define space withrespect to borehole 106 during drilling.

In particular, magnetometer measurements 200 and accelerometermeasurements 201, although generally valid as shown for any orientation,are depicted for the special case of straight vertical drilling.Accordingly, for straight vertical drilling, a positive Z-axis pointsinto the wellbore direction, while the XY axes define an XY planeperpendicular to the wellbore direction along the Z-axis. Also, forstraight vertical drilling, axial component vector B_(z) may be referredto as B_(vertical), while vector B_(xy) may be referred to asB_(horizontal). As shown in FIGS. 2A and 2B, a positive X axis isaligned with the geographic north direction, a negative X axis isaligned with the geographic south direction, a positive Y axis isaligned with the geographic west direction, and a negative Y axis isaligned with the geographic east direction. It will be understood thatsuch orientations and polarities may be arbitrary and may be modified indifferent embodiments or for different orientations of borehole 106.

During drilling, as drill string 146 is caused to rotate, downhole tool166 (i.e., MWD tool also rotates in the XY plane, while motion along theZ-axis may remain relatively steady, according to the ROP. The MWD toolmay include a 3D magnetometer that measures and outputs axial componentsB_(x), B_(y), B_(z) of total magnetic field B, as well as a 3Daccelerometer that measures and outputs axial components G_(x), G_(y),G_(z) of total gravity G. Based on these raw measurements, aninclination angle and an azimuth angle of the bottom hole assembly (BHA)can be calculated in, order to determine a location and orientation ofborehole 106 at a given well depth. Therefore, the accuracy of themeasured quantities for B and G may be critical for determining thelocation and orientation of borehole 106.

In FIG. 2A, magnetometer measurements 200 depict to Cartesian coordinatespace about an origin 210. For example, origin 210 may represent acurrent location of the BHA as a reference point for magnetometermeasurements 200. From origin 210, magnetometer measurements 200 definethe axial components B_(x), B_(y), B_(z) of total magnetic field b. Alsodefined by magnetometer measurements 200 is a vector B_(xy) that is thesum of axial components B_(x) and B_(y) and which also defines amagnetic dip angle φ and a declination angle θ.

In FIG. 2B, accelerometer measurements 201 depict a Cartesian coordinatespace about origin 210. For example, origin 210 may represent a currentlocation of the BHA as reference point for accelerometer measurements201. From origin 210, accelerometer measurements 201 define the axialcomponents G_(x), G_(y), G_(z) of total gravity G.

Given the vectors G={G_(x),G_(y),G_(z)} and B={B_(x),B_(y),B_(z)}, wherethe subscripts denote axial components and boldface denotes a vectorquantity, Equations 1, 2, and 3 below define the quantities of B, G, andmagnetic dip angle φ.

$\begin{matrix}{{G} = {\sqrt{G_{x}^{2} + G_{y}^{2} + G_{z}^{2}}}} & \left( {{Equation}\mspace{14mu} 1} \right) \\{{B} = {\sqrt{B_{x}^{2} + B_{y}^{2} + B_{z}^{2}}}} & \left( {{Equation}\mspace{14mu} 2} \right) \\{\varphi = {\sin^{- 1}\left( \frac{G \cdot B}{{G} \cdot {B}} \right)}} & \left( {{Equation}\mspace{14mu} 3} \right)\end{matrix}$

The quantities |B|, |G|, and φ from Equations 1-3, respectively, can becompared with reference values to calculate corresponding residualvalues. Then, using characteristic values indicative of instrumentperformance (i.e., MWD tool codes, or more generally, an instrumentperformance model, such as specified by tool codes) adaptive QC criteriafor the MWD tool may be determined. In other words, for a downholesurvey that fails QC, the raw measurements from the MWD tool are highlyunlikely to fulfill the specifications of the MWD tool codes. Morespecifically, a failed QC evaluation may indicate that the calculatedresidual values exceed QC thresholds derived from the MWD tool codes, aswill now be described in further detail.

An instrument performance model may incorporate certain assumptionsabout sources of error. The instrument performance model may be used inthe form of coefficients (also referred to as “tool code errorcoefficients” or simply “tool codes”) that describe different errorsources. For example, the sources of error in MWD tool codes may beresponsible for related errors in |B|, |G|, and φ. Thus, for the MWDtool codes, which quantifies the error sources, the resulting errors in|B|, |G|, and φ can be computed. Table 1 below shows which tool codeerror coefficients influence which error sources in the QC parametersfor an MWD tool. The values in Table 1 may be assumed to be given valuesand may be used as input values for the subsequent operations using acovariance matrix, as explained in further detail below.

TABLE 1 Tool code error coefficients for various error sources. ErrorSource |G| |B| φ Reference model AFI MFI MDI Accelerometer bias AB ABAccelerometer scale factor AS AS Magnetometer bias MB MB Magnetometerscale factor MS MS Axial interference AMIL AMILCovariance Matrix

The tool code error coefficients in Table 1 may be used to calculate theterms of a first covariance matrix for a single MWD survey. Equation 4specifies a first covariant matrix S₁, while Equations 5 through 10describe the calculation of the matrix elements in terms of theintermediate values that depend on the coefficients in Table 1.

$\begin{matrix}{S_{1} = \begin{bmatrix}{\delta\; G^{2}} & {\delta\; G\;\delta\; B} & {\delta\; G\;{\delta\varphi}} \\{\delta\; G\;\delta\; B} & {\delta\; B^{2}} & {\delta\; G\;{\delta\varphi}} \\{\delta\; G\;\delta\;\varphi} & {\delta\; B\;\delta\;\varphi} & {\delta\;\varphi^{2}}\end{bmatrix}} & \left( {{Equation}\mspace{14mu} 4} \right)\end{matrix}$Elements in the Covariance Matrix

The calculation of the elements of the covariance matrix S₁ is given inEquations 5 through 10 in terms of various intermediate values (i.e.,error terms) related to the coefficients in Table 1.δG ² =GT0+GT1+GT2  (Equation 5)δB ² =BT0+BT1+BT2+BT3  (Equation 6)δφ² =DIP0+DIP1+DIP2+DIP3+DIP4+DIP5  (Equation 7)δGδB=0  (Equation 8)δGδφ=(GT1/DIP5)+(GT2/DIP6)  (Equation 9)δBδφ=(BT1/DIP1)+(BT2/DIP2)+(BT3/DIP4)  (Equation 10)

The formulas for calculating the intermediate values in Equations 5through 10 will now be described. The convention used to name theintermediate values herein is GT_(n) for |G|, BT_(n) for |B|, andDIP_(n) for φ, where n is a non-negative integer.

G Error Estimates

GT0; The reference error in G is a constant value of coefficientAFI=0.016 m/s² in Table 1 that may be determined as the RMS differencebetween the Global Acceleration Reference Model (GARM 2013) and normalgravity of 9.80655 m/s² for a global average down to 8000 m depth, asgiven by Equation 11.

$\begin{matrix}{{{GT}\; 0} = {{{AF}\; 1} = {0.016\;\frac{m}{s^{2}}}}} & \left( {{Equation}\mspace{14mu} 11} \right)\end{matrix}$

GT1: An accelerometer bias (also referred to as an offset, drift, orintercept) represents a constant offset that distorts a true value toappear as a measurement value. Accordingly, for G_(x) the bias term isgiven by Equation 12.G _(x) ^(true) =G _(x) ^(measured) −GT1  (Equation 12)In Equation 5, G_(x) ^(measured) is a measured value for G_(x), andG_(x) ^(true) is a true value for G_(x), while GT1 (also referred to asδG_(x)) may be obtained from coefficient AB for accelerometer bias inTable 1 as the value AB², as given by Equation 13. It is noted thatsimilar equations apply for the Y and Z axes. Furthermore, it may beassumed that all axial accelerometer biases are equal to enablecalculation of G_(y) ^(true) and G_(z) ^(true).GT1=AB ²  (Equation 13)

GT2: The intermediate value GT2 is given by Equation 14 terms of thecoefficient AS in Table 1.

$\begin{matrix}{{{GT}\; 2} = {\frac{{AS}^{2}}{{G}^{2}}\left( {G_{x}^{4} + G_{y}^{4} + G_{z}^{4}} \right)}} & \left( {{Equation}\mspace{14mu} 14} \right)\end{matrix}$B Error Estimates

BT0: The reference error in b is the coefficient MFI in Table 1 as givenby Equation 15.BT0=MFI  (Equation 15)BT1: the calculations for BT1 are substantially similar to GT1 exceptfor application to the vector B and using the coefficient in Table 1 MBfor magnetometer bias instead of AB for accelerometer bias, as given byEquation 16.BT1=MB ²  (Equation 16)

BT2: The calculations for BT1 are substantially similar to GT1 exceptfor application to the vector B and using the coefficient in Table 1 MSfor AS for accelerometer scale, as given by Equation 17.

$\begin{matrix}{{{BT}\; 2} = {\frac{{MS}^{2}}{{G}^{2}}\left( {G_{x}^{4} + G_{y}^{4} + G_{z}^{4}} \right)}} & \left( {{Equation}\mspace{14mu} 17} \right)\end{matrix}$

BT3: To the calculation of BT3, an additional bias term in thealong-hole z direction appears, and BT3 is calculated using thecoefficient in Table 1 AMIL for axial interference, as given by Equation18.

$\begin{matrix}{{{BT}\; 3} = {\frac{B_{z}^{2}}{{B}^{2}}{AMIL}^{2}}} & \left( {{Equation}\mspace{14mu} 18} \right)\end{matrix}$φ Error Estimates

DIP0: The reference error in φ is the coefficient MDI in Table 1 asgiven by Equation 19.DIP0=MDI  (Equation 19)

DIP1: The error term DIP1 is given in terms of the coefficient MB formagnetometer bias in Table 1 as given by the Equation 20.

$\begin{matrix}{{{DIP}\; 1} = {\frac{{MB}^{2}}{{G}^{2}{B}^{6}\left( {1 - \left( {g \cdot b} \right)^{2}} \right)}\left( {\left( {{{B}^{2}G_{x}} - {\left( {G \cdot B} \right)B_{x}}} \right)^{2} + \left( {{{B}^{2}G_{y}} - {\left( {G \cdot B} \right)B_{y}}} \right)^{2} + \left( {{{B}^{2}G_{z}} - {\left( {G \cdot B} \right)B_{z}}} \right)^{2}} \right)}} & \left( {{Equation}\mspace{14mu} 20} \right)\end{matrix}$

In Equation 20, the quantity (g·b) is defined as given by Equation 21.

$\begin{matrix}{\left( {g \cdot b} \right) = \frac{G \cdot B}{{G} \cdot {B}}} & \left( {{Equation}\mspace{14mu} 21} \right)\end{matrix}$

DIP4: The error term DIP4 is given in terms of the coefficient AB foraccelerometer bias in Table 1 as given by Equation 22, in which certainterms for G and B are exchanged and Equation 21 yields the quantity(g·b).

$\begin{matrix}{{{DIP}\; 4} = {\frac{{AB}^{2}}{{G}^{2}{B}^{6}\left( {1 - \left( {g \cdot b} \right)^{2}} \right)}\left( {\left( {{{G}^{2}B_{x}} - {\left( {G \cdot B} \right)G_{x}}} \right)^{2} + \left( {{{G}^{2}B_{y}} - {\left( {G \cdot B} \right)G_{y}}} \right)^{2} + \left( {{{G}^{2}B_{z}} - {\left( {G \cdot B} \right)G_{z}}} \right)^{2}} \right)}} & \left( {{Equation}\mspace{14mu} 22} \right)\end{matrix}$

DIP2: The error term DIP2 is given in terms of the coefficient MS formagnetometer scale in Table 1 as given by Equation 23, while Equation 21yields the quantity (g·b).

$\begin{matrix}{{{DIP}\; 2} = {\frac{{MS}^{2}}{{G}^{2}{B}^{6}\left( {1 - \left( {g \cdot b} \right)^{2}} \right)}\left( {{B_{x}^{2}\left( {{{B}^{2}G_{x}} - {\left( {G \cdot B} \right)B_{x}}} \right)}^{2} + {B_{y}^{2}\left( {{{B}^{2}G_{y}} - {\left( {G \cdot B} \right)B_{y}}} \right)}^{2} + {B_{z}^{2}\left( {{{B}^{2}G_{z}} - {\left( {G \cdot B} \right)B_{z}}} \right)}^{2}} \right)}} & \left( {{Equation}\mspace{14mu} 23} \right)\end{matrix}$

DIP5: The error term DIP5 is given in terms of the coefficient MS formagnetometer scale in Table 1 as given by Equation 24, which is similarto Equation 23, but with certain values for G and B exchanged and usingMS instead of AS, while Equation 21 yields the quantity (g·b).

$\begin{matrix}{{{DIP}\; 5} = {\frac{{MS}^{2}}{{G}^{2}{B}^{6}\left( {1 - \left( {g \cdot b} \right)^{2}} \right)}\left( {{G_{x}^{2}\left( {{{G}^{2}B_{x}} - {\left( {G \cdot B} \right)G_{x}}} \right)}^{2} + {G_{y}^{2}\left( {{{G}^{2}B_{y}} - {\left( {G \cdot B} \right)G_{y}}} \right)}^{2} + {G_{z}^{2}\left( {{{G}^{2}B_{z}} - {\left( {G \cdot B} \right)G_{z}}} \right)}^{2}} \right)}} & \left( {{Equation}\mspace{14mu} 24} \right)\end{matrix}$

DIP3: The error term DIP3 is given in terms of the coefficient AMIL foraxial interference in Table 1 as given by Equation 25, while Equation 21yields the quantity (g·b).

$\begin{matrix}{{{DIP}\; 3} = {\frac{{AMIL}^{2}}{{G}^{2}{B}^{6}\left( {1 - \left( {g \cdot b} \right)^{2}} \right)}\left( {{{B}^{2}G_{z}} - {\left( {G \cdot B} \right)B_{z}}} \right)^{2}}} & \left( {{Equation}\mspace{14mu} 25} \right)\end{matrix}$Generalized Covariance Matrix for sets of Surveys of all Types

A generalized method, similar to the first covariance matrix, may beused in order to produce a second covariance matrix S₂ that describes aset of surveys for a given well, or a number of survey legs comprisingsome number of wells. Second covariance matrix S₂ may be impacted by anarbitrary number of errors sources, some of which may be correlatedacross some or all of the surveys based on which leg or which well thesurveys belong to.

A general reference quality, R, of known value is considered, which maybe, B, G, magnetic dip angle φ, or another reference value, where aresidual value will be used to measure the quality of a survey point. Aset of surveys may then be associated with a collection of residualvalues determined by subtracting measured values of R from associatedtheoretical quantities related to R.

A design matrix A can be constructed using the partial derivatives ofthe reference value R with respect to an error source r for eachmeasurement of the reference criteria. For a set of n referencemeasurements that may be corrupted by m different error sources, eacherror source having a respective magnitude of ε_(i), the design matrix Amay be is defined as given in Equation 26.

$\begin{matrix}{A = \begin{bmatrix}{ɛ_{1}\frac{\partial R_{1}}{\partial ɛ_{1}}} & \ldots & {ɛ_{1}\frac{\partial R_{n}}{\partial ɛ_{1}}} \\\vdots & \ddots & \vdots \\{ɛ_{m}\frac{\partial R_{1}}{\partial ɛ_{m}}} & \ldots & {ɛ_{m}\frac{\partial R_{n}}{\partial ɛ_{m}}}\end{bmatrix}} & \left( {{Equation}\mspace{14mu} 26} \right)\end{matrix}$

It is noted that in design matrix A, globally propagated errors mayappear as a single error source, well level errors may be included oncefor each well to which the well level errors apply, systematic errorsmay be included once for each survey leg to which the systematic errorsapply, and random errors may be included once for each survey to whichthe random errors apply.

After computing design matrix A, second covariant matrix S₂ may becomputed as a generalized error covariance matrix using, crossmultiplication of design matrix A. Second covariant matrix S₂ may haven×n elements and may relate the expected errors in any referencequantity for any particular survey to the same errors in any otherreference quantity in any other survey. Second covariant matrix S₂ isgiven by Equation 27.

$\begin{matrix}{S_{2} = {{A^{T}A} = \begin{bmatrix}{\delta\; R_{1}^{2}} & \ldots & {\delta\; R_{1}\delta\; R_{n}} \\\vdots & \ddots & \vdots \\{\delta\; R_{n}\delta\; R_{1}} & \ldots & {\delta\; R_{n}^{2}}\end{bmatrix}}} & \left( {{Equation}\mspace{14mu} 27} \right)\end{matrix}$Evaluating QC Criteria from Multiple Surveys

As described with respect to method 300-1 (see FIG. 3), an errorcovariance matrix S₁ was used for each individual survey station usingthe error sources identified in instrument tool codes, in a furtheraspect, a determination may be made whether the errors in a new surveystation are consistent with the errors observed in prior survey stationsalong the same borehole. The determination may also evaluate whether theerrors from a group of survey stations are, when taken together,acceptable based on error values, in this manner, a criterion may bedeveloped to generate new it from a survey station that may indicate QCescalation of a set of surveys for review by an expert. In other words,it may be determined whether the new errors in a survey are consistentor not with errors from one or more previous surveys, such as surveysfor the same borehole, among other different kinds of surveys.

In this regard, a criterion may be generated for whether a survey set,(i.e., a plurality of surveys) when taken as a whole, indicatesescalation for review by an expert, for example, for having errors notconsistent with, reference error values and not consistent with errorsources included in the MWD tool codes (see Table 1).

It is noted that any so-called “escalation criteria” may be considered adecision point for an automated drilling system, because an automatedsystem may be enabled to evaluate the escalation criteria and performthe escalation, when indicated.

Accordingly, second covariance matrix S₂ may be generated for a set ofseveral surveys defined through the propagation modes in the errorvalues, as described previously. The second covariance matrix S₂ for theset of surveys may describe how errors in one survey affect errors in adifferent survey within the set of surveys. For example, the set ofsurveys may include surveys within, the same bore hole that are madeusing the same MWD surveying tool. However, second covariance matrix S₂may be generated for surveys taken by differing survey instruments, oreven surveys in different boreholes, because the relationships betweenvarying elements can be derived from the tool codes used to perform thevarious surveys. Accordingly, more than one tool code error value ormore than one borehole may form the basis for second covariance matrixS₂ for the set of surveys.

Second covariance matrix S₂ for the set of surveys may provide a methodapplicable to notional future surveys that have not been measured yet,but have a theorized orientation that can be used in conjunction withthe error values. Once second email alto; matrix S₂ is constricted, setof surveys can be evaluated by computing a Mahalanobis distance for themeasured values of the QC criteria for all surveys. The Mahalanobisdistance can be used to determine the probability that a survey toolthat meets error expectations produces the measured values (a P-value).

When only some of the surveys have been measured (but some are notionalfuture surveys), the values of the measured surveys can be used toproduce a second covariance matrix S₂ that reduces the acceptable QCrange for the future surveys based on what has already been, measured.The second covariance matrix S₂ can be used to calculate a conditionalMahalanobis distance, which may enable acceptance or rejection of thenew survey data in the context of the previous data.

Furthermore, tolerances may be defined (e.g., by a user) for both theoverall probability (P-value) as well as the conditional Mahalanobisdistance (marginal sigma) that enable automated acceptance or rejectionof surveys by a non-expert user, or by an automated drilling system. Theacceptance/rejection criteria can be used to construct a more accuratewellbore, or to alert an expert user that detailed evaluation isindicated.

The QC method involving second covariance matrix S₂ for the set ofsurveys can be used in conjunction with surveys intended for a collisionavoidance scan such that a user may be alerted to a potential failure ofsurveys to accurately convey a risk of a borehole collision.

Computed Covariance Matrix S₁, and Derived Quantities, Computed fromError Values

Every survey station along the well trajectory may be associated with adifferent covariance matrix S₁, due to the changing orientation of thewellbore. So, for every survey station, the elements of covariancematrix S₁ may be computed using Equations 4 through 25 given above, asindicated. After calculation of the covariance matrix S₁, the followingmatrices can be computed: an inverse of covariance matrix S₁; aneigenvector decomposition of the covariance matrix S₁; a root of thecovariance matrix; an inverse of the root of the covariance matrix; aminimum intersection, with axis, and maximum, of the 1-sigma ellipsoidwith the three coordinate system axes for B, G, magnetic dip angle φ.These matrices may be used tri compute QC criteria and display the QCcriteria in various different kinds of plots. In variousimplementations, the following inputs may be used for computations: toolcode error coefficients, wellbore inclination angle, wellbore azimuthangle, gravity reference field, and magnetic reference field; while thefollowing output values may be calculated: a covariance matrix, aninverse covariance matrix, a root covariance matrix, an inverse rootcovariance matrix, a projection of an ellipsoid onto a 3 coordinatesystem axes, a minimum in sector, and a maximum in sector.

Computing Statistical Distances and Ranges for a Set of MWD Surveys

For a given set of QC parameter residual values dB, dG and dφ,additional computations may be performed, such as statistical distancesand ranges for a set of MWD surveys.

Statistical Distance: The statistical distance of a given set ofresiduals given by a vector r={dB, dG, dφ} is computed as given byEquation 28.Statistical Distance=√{square root over (r^(t)cov⁻¹ r)}  (Equation 28)

Residual Statistical Distances: The separate residual statisticaldistances corresponding to the individual B, G and φ axes may becalculated as projections on a given axis.

Outer Error Bounds: The outer error bounds represent maximum values forthe 3 axes (B, G and φ) of an outer bounding of the ellipsoid, which isunambiguous. Because the maximum values lie at an extreme point on theellipsoid, the maximum value may be determined by setting the derivativeof a parameterization to zero and solving for respective values of (B, Gand φ).

Inner Error Bounds: The inner error bounds represent minimum values forthe 3 axes (B, C and φ) of an inner bounding box of the ellipsoid. Incontrast to the outer bounding box, there may be ambiguity in definingan inner bounding box because of sectors in which one of the (B, G andφ) may dominate. For this purpose, sectors may be defined as linesthrough the ellipsoid and used for calculation of the inner error boundsby using a root of the covariance matrix. Scaling by the sigma valuesinstead of the diagonals of the root of the covariance matrix may alsobe used.

After two or more surveys in a set have been collected and associatedresidual values have been computed, the known covariance between thesurveys in the set and future surveys can be used to further reline theexpected errors in future measurements. The procedure is similar to thatdescribed above with covariant matrix S₂, but involves replacingcovariant matrix with a new covariant matrix S₃ that may be aconditional covariance matrix. It is noted that similar or equivalenttypes of displays and user interfaces used with covariant matrix S₁ maybe generated using covariant matrices S₂ and S₃.

Starting from generalized covariant matrix S₂ having n×n elements, oncek number of measurements have been collected, partition matrix S₂ togenerate a partitioned matrix S₃ having the following sub-matrices; 1)Σ_(k)—an error covariance sub-matrix having k×k elements and containingthe relations of reference measurements already collected; 2) Σ_(n)—asub-matrix having (n−k)×(n−k) elements and containing the relations ofmeasurements yet to be evaluated, and 3) Σ_(kn) and Σ_(nk)—twosub-matrices, one having k×(n−k) elements, the other having (n−k)×kelements, that contain the relations between sub-matrices Σ_(k) andΣ_(n). The partitioned matrix S3 is given by Equations 29 and 30.

$\begin{matrix}{S_{3} = \begin{bmatrix}{\delta\; R_{1}^{2}} & \ldots & {\delta\; R_{1}\delta\; R_{k}} & {\delta\; R_{1}\delta\; R_{k + 1}} & \ldots & {\delta\; R_{1}\delta\; R_{n}} \\\vdots & \ddots & \vdots & \vdots & \ddots & \vdots \\{\delta\; R_{k}\delta\; R_{1}} & \ldots & {\delta\; R_{k}^{2}} & {\delta\; R_{k}\;\delta\; R_{k + 1}} & \ldots & {\delta\; R_{k}\delta\; R_{n}} \\\begin{matrix}{\delta\; R_{k + 1}} \\{\delta\; R_{1}}\end{matrix} & \ldots & \begin{matrix}{\delta\; R_{k + 1}} \\{\delta\; R_{k}}\end{matrix} & {\delta\; R_{k + 1}^{2}} & \ldots & \begin{matrix}{\delta\; R_{k + 1}} \\{\delta\; R_{n}}\end{matrix} \\\vdots & \ddots & \vdots & \vdots & \ddots & \vdots \\{\delta\; R_{n}\delta\; R_{1}} & \ldots & {\delta\; R_{n}\delta\; R_{k}} & {\delta\; R_{n}\delta\; R_{k + 1}} & \ldots & {\delta\; R_{n}^{2}}\end{bmatrix}} & \left( {{Equation}\mspace{14mu} 29} \right) \\{S_{3} = \begin{bmatrix}\sum_{k} & \sum_{kn} \\\sum_{nk} & \sum_{n}\end{bmatrix}} & \left( {{Equation}\mspace{14mu} 30} \right)\end{matrix}$

A conditional covariance for the remaining surveys, Σ_(n,conditional)can be computed by taking Σ_(n) and subtracting the variance that wouldbe explained by the prior measurements, as given in Equation 31.Σ_(n,conditional)=Σ_(n)−Σ_(nk)Σ_(k) ⁻¹Σ_(kn 9)  (Equation 13)

When evaluating a survey against the conditional covariance matrixΣ_(n,conditional), the error residuals may no longer have a zeroexpectation as errors that are correlated between the two groups ofsurveys may be expected to persist. Evaluation of survey residuals maythen be performed against a conditional center μ that can be computedusing a 1×k sized vector of measured residuals, R_(k) and thepartitioned matrix components previously defined, as given in Equation32.μ=Σ_(nk)Σ_(k) ⁻¹R_(k)  (Equation 32)

Referring now to FIGS. 3A, 3B, 3C and 3D, flowcharts of selectedelements of an embodiment of a method 300 for adaptive quality controlfor monitoring wellbore drilling, as disclosed herein, is depicted. InFIG. 3A, method 300-1 comprising steps 302 through 318 describe a methodof adaptive quality control on a single MWD survey. In FIG. 3B, method300-2 comprising steps 320 through 328 describes additional operationfor evaluating QC and generating an alarm to indicate that drillingshould stop. In FIG. 3C, method 300-3 comprising steps 330 through 342describes a method of adaptive quality control on multiple MWD surveys.In FIG. 3D, method 300-4 comprising steps 350 through 356 describes amethod of adaptive quality control on MWD surveys for an entire well.Method 300-4 may be performed after drilling of the well is complete, ormay be performed during drilling of the well. It is noted that certainoperations described in method 300 may be optional or may be rearrangedin different embodiments.

Method 300-1, may begin in FIG. 3A, at step 302, by drilling to a firstsurvey point specified in a well plan. At step 304, at the first surveypoint, an actual magnetic filed vector B and an actual gravity vector Gare measured using a MWD tool and actual magnetic dip angle φ iscalculated. At step 306, a reference B_(ref) vector are obtained. Atstep 308, a reference G_(ref) vector are obtained. At step, 310 B_(ref)is compared with actual B, G_(ref) is compared with actual G, andφ_(ref) is compared with actual φ to generate residual values. It isnoted that φ_(ref) may be calculated using B_(ref) and G_(ref). At step312, MWD tool error coefficients are obtained. At step 314, astatistical distance using the residual values for B, G, and φ iscomputed. At step 316, a σ threshold is obtained. At step 318, thestatistical distance is evaluated against the a threshold for QCvalidation. After step 318, method 300-1 may proceed to method 300-2 inFIG. 3B.

Method 300-2, may begin in FIG. 3B, at step 320 (from either step 318 orstep 342), by making a decision whether QC passed. When the decision instep 320 is YES and QC passed, at step 326, a decision is made whetherdrilling is done. When the decision in step 326 is NO and drilling isnot done, method 300-2 may proceed to step 330. When the decision instep 326 is YES and drilling is done, method 300-2 may proceed to step350. When the decision in step 320 is NO and QC failed, at step 322, analarm to stop drilling and, an indication for expert review of surveyresults are generated. The alarm in step 322 may be a simple audio orvisual indication. The alarm in step 322 may be a message to a controlsystem of a drilling system to stop drilling. At step 324, a decision ismade whether it is ok to resume drilling. When the decision in step 324is YES and it is of to resume drilling, method 300-2 may proceed to step330. When the decision in step 324 is NO and it is not ok to resumedrilling, at step 328, an indication is generated to repeat the previoussurvey. After step 328, method 300-2 may proceed to step 336.

Method 300-3, may begin in FIG. 3C, at step 330 by continuing to a nextsurvey point in the well plan. At step 312, MWD tool error coefficientsare obtained. At step 332, the statistical distance calculation isupdated using previously accepted surveys and associated error values.At step 334, second reference values for B, G and φ are calculated. Atstep 336, at a next survey point, actual magnetic field vector B andactual gravity vector G are measured using an MWD tool and actualmagnetic dip angle φ is calculated. At step 338, actual B, G and φvalues are compared with the second reference B, G and φ values togenerate second residual values. At step 340, a second statisticaldistance is calculated using the second residual values for B, G and φand the statistical distance calculation updated in step 332. At step316, a σ threshold is obtained. At step 342, the second statisticaldistance is evaluated against the σ threshold for QC validation.

Method 300-4, may begin in FIG. 3D, at step 350 by updating thestatistical distance calculation for a set of surveys for an entirewell. At step 352, a statistical probability is computed using theupdated statistical distance calculation in step 350. At step 316, a pthreshold is obtained. At step 356, the second statistical distance isevaluated against the p threshold for QC validation of the entire well.

Displaying the QC Criteria

In FIGS. 4 through 11, 12A, and 12B, various user interface elementsshowing QC criteria and indications of QC results are depicted as may bedisplayed to a user. The display of the plots and graphs in FIGS. 4through 11, 12A, and 12B may be generated for visualization and use bythe user during drilling or for post-drilling analyses. As notedpreviously, QC criteria for (B, G and φ) may be mathematicallyillustrated as a 3D ellipsoid. As shown in FIG. 4, if a sigma value of2.8 (95% confidence in 3D) is used to compute error ellipses for wellplanning, then any residual value vector of (dG, dB and dφ) that liesoutside of 2.8 times the 1-sigma error ellipse can be considered to failthe QC criteria. However, while exact QC thresholds for parameters maynot be definable, areas in 2D (or volumes in 3D) can be defined withinwhich the survey may pass QC (QCP), may pass or fail QC (QCPF), or mayfail QC (QCF), as shown in FIG. 5, which depicts a 2D projection of anellipsoid 502, such as the ellipsoid shown in FIG. 4.

Referring now to FIG. 6, a plot of overall statistical distances isshown. In FIG. 6, the statistical distance (or 3D sigma) as disclosedherein is shown. FIG. 6 shows an easy to understand display because athreshold line shows if the value is above or below a threshold valuefor the survey to fail QC. In FIG. 6, a dark plot 602 represents thesecond statistical distance described in method 300, while a light plot604 represents the first statistical distance described in method 300. Aconstant 2σ value is shown as a threshold line 606 for ease ofevaluation. As is evident from FIG. 6, the use of multiple surveys andthe second statistical distance results in improved QC for the samemeasurements.

In FIGS. 7, 8, and 9, plots of residual distances along with certain QCthresholds are shown for B, G and φ respectively. The plots in FIGS. 7-9are for the same QC analysis as shown in FIG. 6 above. In FIGS. 7-9, alight line 702 are QC limits as calculated using a conventional methodspecified in Society of Petroleum Engineers (SPE) Publication No.103734, a dark line 704 are QC limits as calculated using method 300-3in FIG. 3C, while data points are the respective measurements (B 706 inFIG. 7; G 708 in FIG. 8, and φ 710 in FIG. 9). It is noted that QClimits 702 are symmetrical and centered about zero, while QC limits 704are adaptive and are not symmetrical and are not centered about zero.

Referring now to FIG. 10, a plot of overall survey likelihood(probability) is shown. The plot in FIG. 10 is for the same QC analysisas shown in FIG. 6 above. In FIG. 10, a threshold line at 10%probability of a survey passing QC is used. FIG. 10 shows an easy tounderstand display because a threshold line shows if the value is aboveor below a threshold value for the survey to fail QC.

In FIGS. 6 through 10, a QC analysis during drilling of a wellbore isdepicted and the individual data points each correspond to an MWD surveyalong the wellbore at the corresponding measured depth. For example,viewing FIG. 6 an overall description of the QC process may be betterunderstood. After the first survey point 610 is taken, a QC fail resultis generated that indicates drilling should stop. Then, upon furtheranalysis, drilling is allowed to proceed and method 300-3 is used tocorrelate errors with previous surveys. As a result, the secondstatistical distance 302 falls below the 2σ threshold and QC passes forall surveys until survey point 612 at about 1,300 m is performed thatfails QC. Analysis of the individual residual value plots shows that thefuture of QC is due to increased error in magnetic field B, seen fromdata point 710 in FIG. 7. In particular, in FIG. 6, the comparisonbetween first statistical distance 601 and second statistical distance602 shows how adaptive QC can improve reliability of QC and preventfalse positives that may indicate too many drilling stops, even whenmeasurements are in fact acceptable.

In FIG. 11, a display to a user is depicted in the form of residualvalue plots (e.g., centered about zero) for B, G and φ respectively,along with respective adaptive QC criteria, such as may be calculatedusing covariant matrices S₁, S₂, or S₃, as described above. In FIG. 12A,a display to a user is depicted in the form of an actual value plot(e.g., centered about a measured value) for magnetic field B, along withrespective adaptive QC criteria, such as may be calculated usingcovariant matrices S₂ or S₃, as described above. In FIG. 12B, a displayto a user is depicted in the form of an actual value plot (e.g.,centered about a measured value) for magnetic dip angle φ, along withrespective adaptive QC criteria, such as may be calculated usingcovariant matrices S₂ or S₃, as described above. In particular, theplots in FIGS. 11, 12A and 12B are shown as respective plots ofmeasurement values bounded by inner limits and outer limits. In FIGS.11, 12A and 12B, the inner limits may indicate pass or fail of themeasurement values and the outer limits may indicate fail of themeasurement values, with respect to adaptive QC criteria. For example,in FIGS. 12A and 12B, both the inner limits and the outer limits narrowthe bounded ranges as drilling proceeds, which indicates that the QCcriteria are adaptive to previous measurements and incorporateconstraints on measured values from previously measured values, such ascalculated using covariant matrix S₂ during drilling, for example. InFIGS. 12A and 12B, the area between the inner limits is displayed as afirst color, and the area between each inner limit and the correspondingouter limit is displayed as a second color. In FIGS. 12A and 12B, thefirst color may be green, while the second color may be yellow, forexample. In FIGS. 12A and 12B, the area beyond, the outer limit may bedisplayed in a third color, winch may be red, for example.

In summary, methods are disclosed for validating directional surveys.The methods disclosed herein describe how errors in the survey areevaluated against various error values to determine if the errors passor fail QC standards. When the errors are found to fail QC standards byany of the methods disclosed herein, an automated drilling systemincorporating the methods disclosed herein may make a determinationwhile drilling. For example, the automated drilling system may determinethat drilling according to a given drilling plan may continue. Inanother example, the automated drilling system may determine thatdrilling according to the drilling plat should be stopped, and maygenerate a corresponding alarm. In yet another example, the automateddrilling system may determine that drilling according to the drillingplan can continue, but that evaluation of certain survey data or certainerrors found in the survey data should be escalated for evaluation by anexpert. In this manner, the methods and determinations described hereinmay support automated drilling and the use of an automated drillingsystem, and may enable precise, accurate, and safe drilling byrelatively inexperienced personnel, because the automated drillingsystem can implement validation of directional surveys, as disclosedherein.

As disclosed herein, a method of validating a directional surveyincludes measuring the gravity and magnetic field vectors using, asurveying tool and computing an overall statistical distance of themeasurement. The statistical distance may be calculated from referencevalues associated with the surveying tool using corresponding surveyingtool codes. In a further aspect, an error covariance math may be used todetermine whether the new errors in a survey are consistent or not witherrors from one or e previous surveys.

The above disclosed subject matter is to be considered illustrative, andnot restrictive, and the appended claims are intended to cover all suchmodifications, enhancements, and other embodiments which fall within thetrue spirit and scope of the present disclosure. Thus, to the maximumextent allowed by law, the scope of the present disclosure is to bedetermined by the broadest permissible interpretation of the followingclaims and their equivalents, and shall not be restricted or limited bythe foregoing detailed description.

What is claimed is:
 1. A system for monitoring drilling, the systemcomprising: a processor; a memory coupled to the processor, wherein thememory comprises instructions executable by the processor for: duringdrilling of a borehole by a drilling system, receiving a first surveyfrom a measurement-while-drilling (MWD) tool, wherein the first surveycomprises a first measurement of a gravity vector G and a secondmeasurement of a magnetic field vector B; calculating a magnetic dipangle φ responsive to the second measurement of the magnetic fieldvector B; generating, a first covariant matrix describing therelationship of a plurality of measured values to expected errors in themeasured values, wherein: generating the first covariant matrixcomprises calculating a plurality of intermediate values based on errorestimates for the first measurement of the gravity vector G, the secondmeasurement of the magnetic field vector B, and the magnetic dip angleφ, wherein the error estimates are calculated using a plurality of toolcode error coefficients; and the first covariant matrix comprises asquare matrix providing joint variance between the plurality ofintermediate values to indicate the relationship of the plurality ofmeasured values to the expected errors in the measured values;generating a plurality of residual values corresponding to the firstmeasurement and the second measurement as a difference between areference value and a measured value for each of first measurement ofthe gravity vector G and the second measurement of the magnetic fieldvector B; computing an error ellipsoid based on the residual values andthe first covariant matrix, wherein the error ellipsoid describes thebounds for residual values for the first measurement of the gravityvector G and the second measurement of the magnetic field vector B;comparing the first survey with the error ellipsoid to determine if thefirst survey is acceptable; and when the first survey is not acceptablebased on the error ellipsoid, generating a first indication that thedrilling should stop.
 2. The system of claim 1, further comprisinginstructions for: when the first indication is generated, generating asecond indication that an assessment of a trajectory of the borehole isto be performed before drilling resumes.
 3. The system of claim 1,further comprising instructions for: generating a plurality of secondresidual values based on differences between a plurality of previouslymeasured values of the gravity vector G and the magnetic vector B, andthe most recent measurements of the gravity vector G and the magneticvector B; generating a second covariant matrix describing therelationship of measured values to expected errors in the measuredvalues based on the previously measured values; and computing a seconderror ellipsoid describing bounds for residual values for the firstmeasurement of the gravity vector G and the second measurement of themagnetic field vector B responsive to the second residual values and thesecond covariant matrix.
 4. The system of claim 1, wherein theinstructions for comparing the first survey with the error ellipsoid todetermine if the first survey is acceptable further compriseinstructions for: computing a statistical distance associated with thefirst measurement of the gravity vector G and the second measurement ofthe magnetic field vector B responsive to the tool codes.
 5. The systemof claim 4, further comprising instructions for: displaying thestatistical distance against a sigma threshold.
 6. The system of claim5, wherein the instructions for comparing the first survey with theerror ellipsoid to determine if the first survey is acceptable furthercomprise instructions for: classifying the first survey as pass or fail,based on a value of the statistical distance with respect to the sigmathreshold.
 7. The system of claim 1, wherein the instructions forcomparing the first survey with the error ellipsoid to determine if thefirst survey is acceptable further comprise instructions for: computinga probability associated with the first measurement of the gravityvector G and the second measurement of the magnetic field vector Bresponsive to the tool codes.
 8. The system of claim 7, furthercomprising instructions for: displaying the probability against aprobability threshold.
 9. The system of claim 8, wherein theinstructions for comparing the first survey with the error ellipsoid todetermine if the first survey is acceptable further compriseinstructions for: classifying the first survey as pass or fail, based ona value of the probability with respect to the probability threshold.10. The system of claim 7, wherein the probability is a Mahalanobisdistance.
 11. A method for monitoring drilling, the method comprising:during drilling of a borehole by a drilling system, receiving a firstsurvey from a measurement-while-drilling (MWD) tool, wherein the firstsurvey includes a plurality of measurements of a gravity vector G and amagnetic field vector B; using the magnetic field vector, calculating amagnetic dip angle φ; generating a first covariant matrix describing therelationship of measurements to expected errors in the measurements,wherein: generating the first covariant matrix comprises calculating aplurality of intermediate values based on error estimates for thegravity vector G, the magnetic field vector B, and the magnetic dipangle φ, wherein the error estimates are calculated using a plurality oftool code error coefficients; and the first covariant matrix comprises asquare matrix providing joint variance between the plurality ofintermediate values to indicate the relationship of the plurality ofmeasured values to the expected errors in the measured values;generating a plurality of residual values corresponding to the pluralityof measurements, wherein each residual value comprises a differencebetween a reference value and a measured value for each of the pluralityof measurements; responsive to the residual values and the firstcovariant matrix, computing an error ellipsoid based on the residualvalues and the first covariant matrix, wherein the error ellipsoiddescribes the bounds for residual values for the plurality ofmeasurements; comparing the first survey with the error ellipsoid todetermine if the first survey is within acceptable limits; and when thefirst survey is not within acceptable limits, generating a firstindication that the drilling should stop.
 12. The method of claim 11,further comprising: when the first indication is generated, generating asecond indication that an assessment of a trajectory of the boreholeshould be performed before drilling resumes.
 13. The method of claim 11,further comprising: generating second residual values based ondifferences between previously obtained measurements and the measuredvalue for each of the plurality of measurements; generating a secondcovariant matrix describing the relationship of measured values toexpected errors in the measured values based on the previously measuredvalues; and responsive to the second residual values and the secondcovariant matrix, computing the error ellipsoid describing bounds forresidual values for the measurements.
 14. The method of claim 11,wherein comparing the first survey with the error ellipsoid to determineif the first survey is acceptable further comprises: computing astatistical distance associated with the measurements based on the toolcodes.
 15. The method of claim 14, further comprising: displaying thestatistical distance against a sigma threshold.
 16. The method of claim15, wherein comparing the first survey with the error ellipsoid todetermine if the first survey is acceptable further comprises:classifying the first survey as pass or fail, based on a value of thestatistical distance with respect to the sigma threshold.
 17. The methodof claim 11, wherein comparing the first survey with the error ellipsoidto determine if the first survey is acceptable further comprises:computing a probability associated with the measurements based on thetool codes.
 18. The method of claim 17, further comprising: displayingthe probability against a probability threshold.
 19. The method of claim18, wherein comparing the first survey with the error ellipsoid todetermine if the first survey is acceptable further comprises:classifying the first survey as pass or fail, based on a value of theprobability with respect to the probability threshold.
 20. The system ofclaim 17, wherein the probability is a Mahalanobis distance.
 21. Themethod of claim 11, further comprising: displaying at least oneindication of the gravity vector, the magnetic field vector, and themagnetic dip angle together with inner error limits, wherein the innererror limits define a pass range.
 22. The method of claim 11, furthercomprising: displaying at least one indication of the gravity vector,the magnetic field vector, and the magnetic dip angle together withouter error limits, wherein the outer error limits define a failthreshold.
 23. The method of claim 11, further comprising: displaying atleast one indication of the gravity vector, the magnetic field vector,and the magnetic dip angle together with both inner error limits andouter error limits, wherein the ranges between the inner error limitsand the outer error limits indicate a pass or fail range.
 24. A systemfor monitoring drilling, the system comprising: a processor; a memorycoupled to the processor; a display device coupled to the processor,wherein the memory comprises instructions executable by the processorfor performing the steps of: during drilling of a borehole by a drillingsystem, receiving a first survey from a measurement-while-drilling (MWD)tool, wherein the first survey includes measurements of a gravity vectorG and a magnetic field vector B; responsive to the magnetic fieldvector, calculating a magnetic dip angle φ; generating a first covariantmatrix describing the relationship of a plurality of measured values toa plurality of expected errors in the measured values, wherein:generating the first covariant matrix comprises calculating a pluralityof intermediate values based on error estimates for the gravity vectorG, the magnetic field vector B, and the magnetic dip angle φ, whereinthe error estimates are calculated using a plurality of tool code errorcoefficients; and the first covariant matrix comprises a square matrixproviding joint variance between the plurality of intermediate values toindicate the relationship of the plurality of measured values to theexpected errors in the measured values; generating residual valuescorresponding to the measurements as differences between each referencevalue and each associated measured value for each of the measurements;responsive to the residual values and the first covariant matrix,computing a statistical distance associated with the measurements, thestatistical distance describing bounds for residual values for themeasurements; and displaying on the display device a comparison of atleast a portion of the first survey with the statistical distance toprovide a visual indication of whether the first survey is withinacceptable limits.
 25. The system of claim 24, further comprisinginstructions for: when the first survey is not within acceptable limits,generating a first indication that the drilling should stop.
 26. Thesystem of claim 24, further comprising instructions for: when the firstindication is generated, generating a second indication that anassessment of a wellbore trajectory of the borehole is to be performedbefore drilling can resume.
 27. The system of claim 24, furthercomprising instructions for: generating second residual values based ondifferences between previously measured values and a most recentlymeasured value for each of the measurements; generating a secondcovariant matrix describing the relationship of measured values toexpected errors in the measured values based on the previously measuredvalues; and using the second residual values and the second covariantmatrix, computing the statistical distance describing bounds forresidual values for the measurements.
 28. The system of claim 24,wherein the instructions for comparing the first survey with thestatistical distance to determine if the first survey is acceptablefurther comprise instructions for: computing an error ellipsoidassociated with the measurements based on the tool codes.
 29. The systemof claim 28, further comprising instructions for: displaying the errorellipsoid against at least one sigma threshold.
 30. The system of claim29, wherein the instructions for comparing the first survey with theerror ellipsoid to determine if the first survey is acceptable furthercomprise instructions for: classifying the first survey as pass or fail,based on a value of the statistical distance with respect to the sigmathreshold.
 31. The system of claim 29, wherein a sigma threshold isdisplayed as a rectangle bounded by the error ellipsoid.
 32. The systemof claim 24, wherein the comparison is displayed as a plot with at leastone shaded region representing a QC threshold.
 33. The system of claim24, wherein the comparison is displayed as a plot of measurement valuesbounded by inner limits and outer limits.
 34. The system of claim 33,wherein the inner limits indicate pass or fail of the measurement valuesand the outer limits indicate fail of the measurement values.
 35. Thesystem of claim 33, wherein the area between the inner limits isdisplayed as a first color, and the area between each inner limit andthe corresponding outer limit is displayed as a second color.
 36. Thesystem of claim 35, wherein the first color is green.
 37. The system ofclaim 36, wherein the second color is yellow.
 38. The system of claim33, further comprising instructions for: accessing data from at leastone previous survey of the borehole performed prior to the first survey,wherein the inner limits and the outer limits are adaptive responsive tothe at least one previous survey.
 39. The system of claim 38, whereinthe visual indication is updated with additional data responsive to asecond survey performed after the first survey.
 40. The system of claim24, wherein the visual indication is updated with additional data as theborehole is drilled.